<template>
  <div class="goods-item">
    <img :src="goods.banner[0].url" alt="" />
    <div class="title">{{ goods.name }}</div>
  </div>
</template>

<script>
export default {
  name: "GoodsItem8",
  props: {
    goods: {
      type: Object,
      default: () => {
        return {
          banner: [
            {
              url:
                "https://ddd.gdyder.com/uploads/20210102/a8f8f31719401998db16da83e0665715.jpg",
            },
          ],
          name: "测试商品",
        };
      },
    },
  },
};
</script>

<style lang="scss" scoped>
.goods-item {
  width: 120px;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 5px;
  display: inline-block;
  margin-left: 40px;
  img {
    width: 120px;
    height: 120px;
    border-radius: 5px;
    padding-bottom: 10px;
  }
  .title {
    font-size: 12px;
    color: #333333;
    line-height: 17px;
    height: 34px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}
</style>
